//
//  personInfoController.m
//  SSSAllRollAgency
//
//  Created by Darker on 2017/3/15.
//  Copyright © 2017年 Darker. All rights reserved.
//

#import "personInfoController.h"
#import "commonCell.h"
#import "userInfoController.h"
#import "myBunkController.h"
#import "myIndentifyController.h"

@interface personInfoController ()<UITableViewDelegate,UITableViewDataSource>
{
    
    UITableView *_infoTabelView;
    NSArray *_dataArray;
}
@end
static NSString *infoID    = @"infoID";
@implementation personInfoController

- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    
    self.title = @"个人资料";
    //去掉透明后导航栏下边的黑边
    //    [self.navigationController.navigationBar setShadowImage:[[UIImage alloc] init]];
    self.navigationController.navigationBar.hidden = NO;
    self.view.backgroundColor = [UIColor colorWithHex:@"F9F9FA"];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    _dataArray = @[@"用户信息",@"我的银行卡"];
    [self setUpApperance];
}
- (void)setUpApperance{
    
    _infoTabelView = [[UITableView alloc]initWithFrame:CGRectMake(0,64+ HeigthIos6CompeteWithCurrent(14), KSCREEN_Width, HeigthIos6CompeteWithCurrent(50)*_dataArray.count) style:UITableViewStylePlain];
    _infoTabelView.delegate = self;
    _infoTabelView.dataSource = self;
    _infoTabelView.separatorStyle = UITableViewCellSeparatorStyleNone;
    _infoTabelView.bounces = NO;
    _infoTabelView.rowHeight = HeigthIos6CompeteWithCurrent(50);
    _infoTabelView.backgroundColor = [UIColor colorWithHex:@"FFFFFF"];
    [self.view addSubview:_infoTabelView];
    _infoTabelView.rowHeight = HeigthIos6CompeteWithCurrent(50);
    _infoTabelView.contentInset = UIEdgeInsetsMake(-64, 0, 0, 0);
    
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return _dataArray.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    Class currentClass = [commonCell class];
    
    commonCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass(currentClass)];
    if (!cell) {
        cell = [[commonCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:infoID];
    }
    cell.nameLabel.text = _dataArray[indexPath.row];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    if (indexPath.row == 1) {
        cell.subTitle.text = @"换绑银行卡";
        cell.lineView.hidden = YES;
    }
    
    //cell.nameLabel.text = _selectedDataArray[indexPath.row];
    return cell;
    
    
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    if (indexPath.row == 0) {
        userInfoController *useInfoVc = [[userInfoController alloc]init];
        [self.navigationController pushViewController:useInfoVc animated:YES];
    }else if (indexPath.row == 1){
        
        myBunkController *myBunkVc = [[myBunkController alloc]init];
        [self.navigationController pushViewController:myBunkVc animated:YES];
    }else if (indexPath.row == 2){
        
        myIndentifyController *myIndentifyVc = [[myIndentifyController alloc]init];
        [self.navigationController pushViewController:myIndentifyVc animated:YES];
        
    }
    
}



@end
